Author: Francois Jalbert ' Date: November 1990
Version: 1.0
Date: April 1991
Version: 2.0
Modifications: - Added four kanjis. - Run-time parameters now supplied. - Extension is .JEM now. - Page format changed slightly. - Symbols now centered within tables. - Switched to since better for tables. */
#include <stdio.h> #ifdef __TURBOC__ #include <process.h> #endif
/* Highest Bitmap number in JIS24 */ #define BitmapMax 7806 /* Highest font number */ #define FontMax 60 /* Number of symbols in a font */ #define SymbolMax 128 #define SymbolMax1 127
void FontTable(FILE *OutFile) int Bitmap; int Font; int Symbol; unsigned char EUC1,EUC2;
fprintf(OutFile,"fprintf(OutFile,"fprintf(OutFile,"
documentstyle[12pt]article");
fprintf(OutFile,"
pagestyleplain");
fprintf(OutFile,"
setlength
oddsidemargin-0.5in fprintf(OutFile,"
setlength
textwidth7.5in fprintf(OutFile,"
setlength
topmargin-0.25in fprintf(OutFile,"
setlength
textheight9.4in fprintf(OutFile,"
setlength
footskip0.1in");
fprintf(OutFile,"
setlength
footheight0.1in");
fprintf(OutFile,"
setlength
headheight0pt");
fprintf(OutFile,"
setlength
headsep0pt");
fprintf(OutFile,"
setlength
topskip0pt");
fprintf(OutFile,"
setlength
parindent0pt");
fprintf(OutFile,"
setlength
tabcolsep4pt");
fprintf(OutFile,"
renewcommand
baselinestretch0.85");
fprintf(OutFile,"
begindocument");
fprintf(OutFile,"
beginLarge");
fprintf(OutFile,"");
fprintf(OutFile,"
vspace*
fill");
fprintf(OutFile,"");
if (ferror(OutFile)) exit(1);
for (Bitmap=0 ; Bitmap<=BitmapMax ; Bitmap++)
Symbol=Bitmap Font=Bitmap / SymbolMax;
EUC1=(unsigned char)((Bitmap-1)/94);
EUC2=(unsigned char)((Bitmap-1)-94*(int)EUC1);
EUC1=EUC1+(unsigned char)'1';
EUC2=EUC2+(unsigned char)'1';
if (!Symbol)
fprintf(OutFile,"
begintable[h]");
fprintf(OutFile,"
centering");
fprintf(OutFile,"
begintabularr|cccccccccccccccc|l");
fprintf(OutFile,
" Code &
multicolumn16c|Characters & EUC
hline");
if (ferror(OutFile)) exit(1);
switch (Symbol case 0: fprintf(OutFile,"if (ferror(OutFile)) exit(1);
break;
case 5: case 10: case 15: fprintf(OutFile," ");
if (ferror(OutFile)) exit(1);
break;
if (Bitmap)
fprintf(OutFile,"&if (ferror(OutFile)) exit(1);
switch (Symbol case 4: case 9: case 14: fprintf(OutFile,"");
if (ferror(OutFile)) exit(1);
break;
default:if ((Symbol fprintf(OutFile,"& if ( (Symbol!=SymbolMax1) && (Bitmap!=BitmapMax) )
fprintf(OutFile,"
");
fprintf(OutFile,"");
if (ferror(OutFile)) exit(1);
else
if (Bitmap==BitmapMax)
fprintf(OutFile,"");
if (ferror(OutFile)) exit(1);
break;
else
fprintf(OutFile,"& ");
if (ferror(OutFile)) exit(1);
if ( (Symbol==SymbolMax1) || (Bitmap==BitmapMax) )
fprintf(OutFile,"
endtabular");
fprintf(OutFile,"
captionFont
tt kanji('a'+(Font/8)),('a'+(Font fprintf(OutFile,"
endtable");
fprintf(OutFile,"");
if (ferror(OutFile)) exit(1);
if (Bitmap==BitmapMax)
fprintf(OutFile,"
vspace*
fill");
fprintf(OutFile,"");
if (ferror(OutFile)) exit(1);
else
if ((Font fprintf(OutFile,"
vspace*
fill");
fprintf(OutFile,"");
fprintf(OutFile,"
clearpage");
fprintf(OutFile,"");
fprintf(OutFile,"
vspace*
fill");
fprintf(OutFile,"");
if (ferror(OutFile)) exit(1);
fprintf(OutFile,"
endLarge");
fprintf(OutFile,"
enddocument